home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue63 / Docking / MultipleClients2U.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-09-27  |  1.0 KB  |  53 lines

  1. unit MultipleClients2U;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
  7.  
  8. type
  9.   TMainForm = class(TForm)
  10.     procedure FormCreate(Sender: TObject);
  11.     procedure FormDockDrop(Sender: TObject; Source: TDragDockObject; X,
  12.       Y: Integer);
  13.   private
  14.     { Private declarations }
  15.   public
  16.     { Public declarations }
  17.   end;
  18.  
  19. var
  20.   MainForm: TMainForm;
  21.  
  22. implementation
  23.  
  24. {$R *.DFM}
  25.  
  26. procedure TMainForm.FormCreate(Sender: TObject);
  27. const
  28.   Colors: array[1..6] of TColor =
  29.     (clWhite, clBlack, clBlue, clGreen, clRed, clYellow);
  30. var
  31.   I: Integer;
  32. begin
  33.   for I := Low(Colors) to High(Colors) do
  34.     with TForm.CreateNew(Self) do
  35.     begin
  36.       Color := Colors[I];
  37.       DragKind := dkDock;
  38.       DragMode := dmAutomatic;
  39.       Position := poDefaultPosOnly;
  40.       Width := 100;
  41.       Height := 100;
  42.       Visible := True;
  43.     end;
  44. end;
  45.  
  46. procedure TMainForm.FormDockDrop(Sender: TObject; Source: TDragDockObject;
  47.   X, Y: Integer);
  48. begin
  49.   DockManager.ResetBounds(True)
  50. end;
  51.  
  52. end.
  53.